This section uses the following table as an example to demonstrate the creation of form model.
Creating Form Template
- Log in to supOS, and then click to go to the design center.
- Select Object Model Management > Object Template > Form Template, and add a new form template.
- Enter the template name, and then click Save.
- On the Attribute tab, click New to add attributes including ID, product, workshop, date and amout with correct data type and unique alias.
Creating Form Instance
- On Object Instance page, select the created form template, and then click New to add an instance.
- Click Save.
- Click Attribute to add rows of data to the form.
- Click New to add a row.
- Click next to an attribute inherited from the parent template, and enter a value.
- Do the same to all attributes, add values from the example table to add a row of data.
Adding Data in Batches
- Select the form template, and then click the Service tab.
- Click New, enter required information and set the Type under Information Output to JSON.
- Click Script, and then click Object Selector to select the embedded server addDataTableEntries to add table data in batches.
- Select the current template, under Service, select addDataTableEntries and then click OK to load the code example.
- Change the input parameters.tip
Go back to the Service page, and copy the input parameter format by clicking the service under Other Service.
- Click Debugging after finishing the code. Data is added when the debugging result is true.